package a.f.j.a;

class g
{
  g a;
  g c;
  e e;
  
  g(e parame, g paramg1, g paramg2)
  {
    this.e = parame;
    this.a = paramg1;
    this.c = paramg2;
  }
  
  e a()
  {
    return this.e;
  }
  
  g a(g paramg)
  {
    boolean bool = c.i;
    if (!bool) {
      if (paramg == this.a) {
        return this.c;
      }
    }
    if ((bool) || (paramg == this.c)) {
      return this.a;
    }
    throw new RuntimeException("Link not known!");
  }
  
  g a(int paramInt)
  {
    return paramInt == 0 ? this.a : this.c;
  }
  
  void a(int paramInt, g paramg)
  {
    boolean bool = c.i;
    if (!bool)
    {
      if (paramInt == 0)
      {
        if (bool) {
          break label29;
        }
        this.a = paramg;
      }
    }
    else if (!c.h) {
      return;
    }
    label29:
    this.c = paramg;
  }
  
  void a(g paramg1, g paramg2)
  {
    boolean bool2 = c.i;
    boolean bool1 = c.h;
    if (!bool2) {
      if (paramg1 == this.a)
      {
        if (bool2) {
          break label41;
        }
        this.a = paramg2;
        if (!bool1) {
          return;
        }
      }
    }
    label41:
    if ((bool2) || (paramg1 == this.c))
    {
      this.c = paramg2;
      if (!bool1) {}
    }
    else
    {
      throw new RuntimeException("Link not known!");
    }
  }
  
  int c(g paramg)
  {
    if (!c.i) {
      if (paramg == this.a) {
        return 0;
      }
    }
    if (paramg == this.c) {
      return 1;
    }
    throw new RuntimeException("Element not adjacent to this element!");
  }
  
  g c()
  {
    boolean bool = c.i;
    if (!bool) {
      if (this.a != null) {
        this.a.a(this, this.c);
      }
    }
    if (!bool)
    {
      if (this.c != null) {
        this.c.a(this, this.a);
      }
      this.a = null;
      this.c = null;
    }
    return this;
  }
  
  void b(g paramg1, g paramg2)
  {
    boolean bool2 = c.i;
    boolean bool1 = c.h;
    if (!bool2) {
      if (paramg1 == this.a)
      {
        this.c.a(this, paramg2);
        paramg2.a(1, this.c);
        this.c = paramg2;
        if (bool2) {
          break label61;
        }
        paramg2.a(0, this);
        if (!bool1) {
          return;
        }
      }
    }
    label61:
    if (!bool2)
    {
      if (paramg1 == this.c)
      {
        this.a.a(this, paramg2);
        paramg2.a(0, this.a);
      }
    }
    else
    {
      this.a = paramg2;
      paramg2.a(1, this);
      if (!bool1) {
        return;
      }
    }
    throw new RuntimeException("Link not known!");
  }
  
  void a(g paramg, a parama)
  {
    boolean bool2 = c.i;
    boolean bool1 = c.h;
    if (!parama.a())
    {
      if (!bool2) {
        if (paramg == this.a)
        {
          this.c.a(this, parama.f());
          parama.c(this.c);
          this.c = parama.e();
          if (bool2) {
            break label137;
          }
          parama.d(this);
          if (!bool1) {
            break label136;
          }
        }
      }
      if (!bool2)
      {
        if (paramg == this.c)
        {
          this.a.a(this, parama.f());
          parama.c(this.a);
        }
      }
      else
      {
        this.a = parama.e();
        if (bool2) {
          break label137;
        }
        parama.d(this);
        if (!bool1) {
          break label136;
        }
      }
      throw new RuntimeException("Link not known!");
      label136:
      label137:
      parama.b();
    }
  }
  
  g c(int paramInt, g paramg)
  {
    g localg = a(paramInt);
    paramg.a(paramInt, localg);
    paramg.a(paramInt ^ 0x1, this);
    localg.a(this, paramg);
    a(paramInt, paramg);
    return paramg;
  }
  
  g a(int paramInt, e parame)
  {
    return c(paramInt, new g(parame, null, null));
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.f.j.a.g
 * JD-Core Version:    0.7.0.1
 */